<?php
class SportsAction extends CommonAction {

    public function _initialize() {
        $this->M = D('kp_user_all');
        parent::_initialize();
    }

    /**
     * 会员列表
     */
    public function daily_sport() {
      if(!empty($_REQUEST)){
        $start_time = $_REQUEST['start_time'];
        $end_time   = $_REQUEST['end_time'];
        /*$start_time_tmp = $start_time?$start_time:date('Y/m/d',time()-30*24*60*60);
        $end_time_tmp = $end_time?$end_time:date('Y/m/d',time());*/
        
        $sql="select st_date,st_more from kp_daily_sports where timestamp(st_date) between '{$start_time}' and '{$end_time}'";
        }else{
            $sql="select st_date,st_more from kp_daily_sports";
        }
        $result=  mysql_query($sql);
        $a = array();
        $c=array();
        while($row = mysql_fetch_row($result)){
                $a[]= $row[1];
                $c[]=$row[0];
        }
         $b=  implode(',', $a);
         $str='';
         foreach($c as $v){
            $str.="'".$v."',";
         }
        $c=rtrim($str,',');
        $this->assign('b', $b);
        $this->assign('c', $c);
        $this->display();
    }
}

